<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org">
<head>
<title>首页</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
	<div id="content">
		<section class="content-header">
			<h1>
				<i class="fa fa-file-image-o"></i> <strong>新建投标</strong>
			</h1>
			<ol class="breadcrumb">
				<li><a href="#"><i class="fa fa-home "></i>Home</a></li>
				<li>投标管理</li>
				<li class="active">新建投标</li>
			</ol>
		</section>
		<!-- Main content -->
		<section class="content">
			<div class="box box-info">
				<div class="box-header with-border">
					<i class="fa fa-th-list"></i>
					<h4 class="box-title">投标信息</h4>
				</div>
				<div class="nav-tabs-custom">
					<ul class="nav nav-tabs">
						<li class="active"><a href="#tab_1" data-toggle="tab">项目信息</a></li>
						<li th:if="${common==1}"><a href="#tab_2" data-toggle="tab">普通价格单</a></li>
						<li th:if="${foreign==1}"><a href="#tab_3" data-toggle="tab">外贸价格单</a></li>
					</ul>
				</div>
				<div class="tab-content">
					<div class="tab-pane active" id="tab_1">
						<input type="hidden" name="bidId" id="bidId" /> <input
							type="hidden" name="createTime" id="createTime" /> <input
							type="hidden" name="quoteType" id="quoteType"
							th:value="${quoteType}" />
							 <input type="hidden" name="customerId" id="customerId" />
						<div class="widget-content nopadding" id="bidForm">
							<table class="table table-bordered">
								<tbody>
									<tr class="odd gradeX">
										<td width="10%" class="center">项目名称</td>
										<td colspan="3">
											<div class="col-md-11">
												<input class="form-control" type="text" id="name"
													name="name" datatype="*,*1-100" nullmsg="请输入项目名称" />
											</div>
											<div class="col-md-1">
												<span style="color: #F00">*</span>
											</div>
										</td>

									</tr>
									<tr class="even gradeC">
										<td width="10%" class="center">招标单位</td>
										<td width="40%">
											<div class="col-md-11">
												<input class="form-control" type="text" id="bidUnit"
													name="bidUnit" datatype="*,*1-100" nullmsg="请输入招标单位" />
											</div>
											<div class="col-md-1">
												<span style="color: #F00">*</span>
											</div>
										</td>
										<td width="10%" class="center">订货单位</td>
										<td width="40%">
											<div class="col-md-9">
												<input class="form-control" type="text" id="ownerUnit"
													name="ownerUnit" datatype="*,*1-100" nullmsg="请输入订货单位" readonly="readonly" />
											</div>
											<div class="col-md-1">
												<span style="color: #F00">*</span>
											</div>
											<div class="col-md-2">
												<button type="button" id="queryCustomer"
													class="btn btn-info" title="引入客户信息">
													<i class="fa fa-search"></i>
												</button>
											</div>
										</td>

									</tr>
									<tr class="odd gradeX">
										<td width="10%" class="center">投标发起人</td>
										<td width="40%">
											<div class="col-md-11">
												<input class="form-control" type="text" id="launcher"
													name="launcher" th:value="${userName}" />
											</div>
										</td>
										<td width="10%" class="center">发起人部门</td>
										<td width="40%">
											<div class="col-md-11">
												<input class="form-control" type="text" id="launch"
													name="launch" readonly="readonly" th:value="${department}" />
												
											</div>
										</td>

									</tr>
									<tr class="even gradeC">
										<td width="10%" class="center">投标类型</td>
										<td width="40%">
											<div class="col-md-11">
												<select class="form-control" id="type" name="type">
													<option th:each="bidType:${bidTypes}"
														th:text="${bidType.title}"></option>
												</select>
											</div>
										</td>
										<td width="10%" class="center">项目类型</td>
										<td width="40%">
											<div class="col-md-11">
												<select class="form-control" id="projectType"
													name="projectType">
													<option th:each="projectType:${projectTypes}"
														th:text="${projectType.title}"></option>
												</select>
											</div>
										</td>

									</tr>
									<tr class="odd gradeX">
										<td width="10%" class="center">保证金方式</td>
										<td width="40%">
											<div class="col-sm-6">
												<select class="form-control" id="cashType" name="cashType"
													onchange="gradeChange()">
													<option th:each="cashType:${cashTypes}"
														th:text="${cashType.title}"></option>
												</select>
											</div>
											<div class="col-sm-3">
												<button class="btn btn-info btnUpload1">上传保函</button>
											</div>
											<div class="col-sm-3">
												<button class="btn btn-info btnList1">下载保函</button>
											</div>
										</td>
										<td width="10%" class="center">保证金金额</td>
										<td width="40%">
											<div class="col-md-11">
												<input class="form-control " type="text" id="cash"
													name="cash" datatype="n" />
											</div>
										</td>
									</tr>
									<tr>
										<td width="10%" class="center">投标日期</td>
										<td width="40%">
											<div class="col-sm-12">
												<input class="form-control" type="date" id="bidDate"
													name="bidDate"
													th:value="${#dates.format(bidDate,'YYYY-MM-dd')}" />
											</div>
										</td>
										<td width="10%" class="center">方案</td>
										<td width="40%">
											<button class="btn btn-info btnUpload2">上传方案</button>
											<button class="btn btn-info btnList2">下载方案</button> <span
											id="techNum" class="badge label-pill label-primary">0</span>
										</td>
									</tr>
								</tbody>
							</table>

							<table class="table table-bordered">
								<tbody>
									<tr class="odd gradeX">
										<td width="10%">商务条款</td>
										<td colspan="7"><textarea class="form-control"
												style="width: 100%" id="terms" name="terms" rows="3"></textarea>
										</td>
									</tr>
									<tr class="odd gradeX">
										<td width="10%">备注</td>
										<td colspan="7"><textarea class="form-control"
												style="width: 100%" id="memo" name="memo" rows="3"></textarea>
										</td>
									</tr>
								</tbody>
							</table>
							<table class="table table-bordered">
								<tbody>
									<tr class="odd gradeX">
										<td width="8%" class="center">是否100万下常规产品</td>
										<td width="17%"><select class="form-control"
											id="isUnder100" name="isUnder100">
												<option>是</option>
												<option>否</option>
										</select></td>
										<td width="8%" class="center">是否新产品或液压隔离泵、自平衡泵</td>
										<td width="17%"><select class="form-control" id="isNew"
											name="isNew">
												<option>是</option>
												<option>否</option>
										</select></td>
										<td width="8%" class="center">是否外贸、除磷系统</td>
										<td width="17%"><select class="form-control"
											id="isForeign" name="isForeign">
												<option>是</option>
												<option>否</option>
										</select></td>
									</tr>
								</tbody>
							</table>


						</div>

					</div>
					<div class="tab-pane" id="tab_2">
						 <div th:replace="bid/quote-common::#common-quote"></div>
					
					</div>
					<div class="tab-pane" id="tab_3">
					    <div th:replace="bid/quote-foreign::#foreign-quote"></div>
					
					</div>
				</div>
				<div>
					<a type="button" class="btn btn-default pull-right"
						href="javascript:history.go(-1)">返回</a>
					<button type="button" class="btn btn-info pull-right saveBidBtn">保存</button>
				</div>
			</div>
		</section>
		<!--引入普通价格单弹窗-->
		<div class="modal" id="QuoteModal">
			<div class="modal-dialog" role="dialog" style="width: 60%">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-label="Close">
							<span aria-hidden="true">&times;</span>
						</button>
						<h4 class="modal-title">
							<strong>价格单信息引入</strong>
						</h4>
					</div>
					<div class="modal-body">
						<div class="form-horizontal">
							<div class="box-body">
								<div class="form-inline">
									<div class="input-group">
										<input type="text" class="form-control" id="keyword"
											placeholder="Search..." /> <span class="input-group-btn">
											<button type="button" id="search-btn"
												class="btn btn-info searchBtn">查询</button>
											<button type="button" id="reset-btn"
												class="btn btn-info resetBtn">撤消</button>
										</span>
									</div>
								</div>
							</div>
							<div class="box box-body">
								<table id="quoteTable"
									class="mytable dataTable table-bordered text-center table-striped table-hover"
									cellspacing="0" width="100%" align="center">
									<thead>
										<tr>
											<th width="8%">序号</th>
											<th width="8%"><input type="checkbox" id="checkAll" /></th>
											<th width="18%">项目名称</th>
											<th width="15%">当前状态</th>
											<th width="15%">总价</th>
											<th width="18%">创建时间</th>
											<th width="18%">备注</th>
										</tr>
									</thead>
									<tbody>

									</tbody>
								</table>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-info" id="pull-quote">引入</button>
						<button type="button" class="btn btn-default" data-dismiss="modal">返回</button>
					</div>
				</div>
			</div>
		</div>
		<!--引入外贸价格单弹窗-->
		<div class="modal" id="foreignQuoteModal">
			<div class="modal-dialog" role="dialog" style="width: 60%">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-label="Close">
							<span aria-hidden="true">&times;</span>
						</button>
						<h4 class="modal-title">
							<strong>外贸价格单信息引入</strong>
						</h4>
					</div>
					<div class="modal-body">
						<div class="form-horizontal">
							<div class="box-body">
								<div class="form-inline">
									<div class="input-group">
										<input type="text" class="form-control" id="foreignkeyword"
											placeholder="Search..." /> <span class="input-group-btn">
											<button type="button" id="search-btn"
												class="btn btn-info foreignsearchBtn">查询</button>
											<button type="button" id="reset-btn"
												class="btn btn-info foreignresetBtn">撤消</button>
										</span>
									</div>
								</div>
							</div>
							<div class="box box-body">
								<table id="foreignQuoteTable"
									class="mytable dataTable table-bordered text-center table-striped table-hover"
									cellspacing="0" width="100%" align="center">
									<thead>
										<tr>
											<th width="8%">序号</th>
											<th width="8%"><input type="checkbox" id="checkAll2" /></th>
											<th width="18%">项目名称</th>
											<th width="15%">当前状态</th>
											<th width="15%">总价</th>
											<th width="18%">创建时间</th>
											<th width="18%">备注</th>
										</tr>
									</thead>
									<tbody>

									</tbody>
								</table>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-info" id="pull-foreignquote">引入</button>
						<button type="button" class="btn btn-default" data-dismiss="modal">返回</button>
					</div>
				</div>
			</div>
		</div>

		<script th:src="@{/bid/bidedit.js}"></script>
		<script th:src="@{/bid/bidQuote.js}"></script>
		<script th:src="@{/bid/bidForeignQuote.js}"></script>
		<script>
			function gradeChange() {
				var objS = document.getElementById("cashType");
				var option = objS.options[objS.selectedIndex].text;
				if (option != "保函") {
					$(".btnUpload1").addClass("hide");
					$(".btnList1").addClass("hide");
				}
				if (option == "保函") {
					$(".btnUpload1").removeClass("hide");
					$(".btnList1").removeClass("hide");
				}
			}
		</script>
	</div>
</body>
</html>